{extend name="common@default/base/ucmobile_base" /}
{block name="body"}
<script type="text/javascript">
    //调用微信JS api 支付
    function onBridgeReady() {
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
            {$jsApiParameters},
            function (res) {
                if (res.err_msg == "get_brand_wcpay_request:ok") {
                    alert('支付成功');
                    history.back();
                }     // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回    ok，但并不保证它绝对可靠。
                if (res.err_msg == "get_brand_wcpay_request:cancel") {
                    alert('取消支付');
                    history.back();
                }
            }
        );
    }

    function callpay() {
        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    }
</script>
<link rel="stylesheet" href="__CSS__/weui2.css">
<link rel="stylesheet" href="__CSS__/weui.css">
<div class="weui-form-preview" style="font-size:42px">
    <div class="weui-form-preview-hd" style="height: 150px;" >
        <label class="weui-form-preview-label">支付价格</label>
        <em class="weui-form-preview-value">¥{$orderData.order_total_price/100}元</em>
    </div>
    <div class="weui-form-preview-bd" >
        <p>
            <label class="weui-form-preview-label">公司名称</label>
            <span class="weui-form-preview-value">{$orderData.delivery_company}</span>
        </p>
        <p>
            <label class="weui-form-preview-label">商品名称</label>
            <span class="weui-form-preview-value">{$orderData.product_name}</span>
        </p>
        <p>
            <label class="weui-form-preview-label">订单号</label>
            <span class="weui-form-preview-value">{$orderData.order_id}</span>
        </p>
    </div>
</div>
<div class="weui-form-preview-ft">
    <a href="#" onclick="callpay()"  class="weui_btn weui_btn_primary" style="width: 100%;height: 100px;font-size: 42px;">微信支付</a>
</div>
{/block}